home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
less177.zip
/
SOURCE.ZIP
/
VECHO.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-18
|
710b
|
50 lines
/*
* This dumb little program emulates the System V "echo" command,
* to accommodate BSD systems which don't understand the \c escape,
* meaning don't echo a newline. BSD uses "echo -n".
*/
#include <stdio.h>
#if OS2
#include "glob.h"
#endif
int putnl;
main(argc, argv)
int argc;
char *argv[];
{
#if OS2
if (argc > 1)
GLOBARGS
#endif
putnl = 1;
while (--argc > 0)
{
vecho(*++argv);
if (argc > 1)
putchar('\t');
}
if (putnl)
putchar('\n');
exit(0);
}
vecho(str)
char *str;
{
register char *s;
for (s = str; *s != '\0'; s++)
{
if (*s == '\\' && s[1] == 'c')
{
putnl = 0;
return;
}
putchar(*s);
}
}